<extend name="Public:base" />
<block name="content">
	<form id="validation-form" method="post" action="{:U('Comment/Del')}">
		<style type="text/css">
			li{
				list-style: none;;
			}
			.mytableer tbody > tr > td{
				padding:0px;
				border: none;
			}
		</style>
	<div class="table-responsive">
		<table class="table table-striped table-bordered table-hover search-form" id="nav-table">
			<thead>
			<th>时间：<input id="startDate" name="start_time" value="{:I('start_time')}" class="Wdate" type="text" onfocus="WdatePicker({dateFmt:'yyyy-M-d 00:00:00'})"/> - <input id="endDate" name="end_time" value="{:I('end_time')}" class="Wdate" type="text" onfocus="WdatePicker({dateFmt:'yyyy-M-d 00:00:00'})"/>

			订单号：<input name="order_id" type="text" placeholder="" value="{:I('order_id')}" style="width:120px;" />

			用户：<input name="user" type="text" placeholder="" value="{:I('user')}" style="width:60px;" />

			师傅：<input name="master" type="text" placeholder="" value="{:I('master')}" style="width:60px;" />

			<a class="btn btn-primary btn-sm radius5" href="javascript:;" id="search" url="{:U('Comment/Warning')}&role=master">查询</a>

			<input  style="{$delete==1?'':'display: none'}" id="submitBtn" type="submit" value="删除"  class="btn btn-danger btn-sm radius5" ></th>
			</thead>
		</table>
	</div>
	</form>
	<div class="table-responsive">
		<table class="table table-striped table-bordered table-hover" id="mytable">
			<thead>
			<tr>
				<th class="center" style="width: 30px"><input id="CheckAll" type="checkbox" /></th>
				<th>序号</th>
				<th>订单编号</th>
				<th>用户</th>
				<th>师傅</th>
				<th>评价内容</th>
				<th>追评</th>
				<th>总星级</th>
				<th>评价情况</th>
				<th>评价时间</th>
				<th>操作</th>
			</tr>
			</thead>
			<tbody>
			<volist name="Warning" id="vo">
				<tr>
					<td class="center"><input name="Del[]" value="{$vo.order_id}" type="checkbox" /></td>
					<td>{$key+1}</td>
					<td>{$vo.order_id}</td>
					<td>{$vo.user_name}<br><span>{$vo.user_phone}</span></td>
					<td>{$vo.id_name}<br><span>{$vo.worker_phone}</span></td>
					<td>{$vo.content}</td>
					<td>{$vo.append_content}</td>
					<td>{$vo.star}</td>
					<td><table class="mytableer">
						<tr><td>上门速度：{$vo.speed}</td></tr>
						<tr><td>服务态度：{$vo.attitude}</td></tr>
						<tr><td>技能水平：{$vo.skill}</td></tr>
						<tr><td>卫生清洁：{$vo.speed}</td></tr>
						<tr><td>收费标准：{$vo.charge}</td></tr>
					</table></td>
					<td>{$vo.add_time}</td>
					<td><a href="{:U('Comment/Visit')}/advise_id/{$vo.order_id}" class="btn btn-xs btn-info radius5">回访记录</a></td>
				</tr>
			</volist>
			<tr>
				<td colspan="20" class="page">{$page}</td>
			</tr>
			</tbody>
			<input type="hidden" name="role_master" value="1"/>
		</table>
	</div>
</block>
<block name="javascript">
	<script>
		$(function(){

			$("#search").click(function () {
				var url = $(this).attr('url');
				var query = $('.search-form').find('input,select').serialize();
				query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
				query = query.replace(/^&/g, '');
				if (url.indexOf('?') > 0) {
					url += '&' + query;
				} else {
					url += '?' + query;
				}
				window.location.href = url;
			});
			$('#CheckAll').click(function () {
				$("input[name='Del[]']").prop('checked', this.checked);
			})

			$("#submitBtn").click(function(){
				var result = new Array(), str = '';
				$('input[name="Del[]"]:checked').each(function () {
					result.push($(this).val());
				});
				var str = result.join(',');
				if (str == '') {
					$.jbox.info('没有选中任何数据！','提示');
					return false;
				}
				var submit = function (v, h, f) {
					if (v == 'ok') {
						$('#validation-form').ajaxSubmit(function(data){
							if(data=='1'){
								$.jbox.tip("正在删除数据...", 'loading');
								// 模拟2秒后完成操作
								window.setTimeout(function () { $.jbox.tip('删除成功。', 'success');location.reload()}, 1000);
							}else if(data=='2'){
								$.jbox.info("删除失败!",'提示');
							}
						});
					}
					else if (v == 'cancel') {
						// 取消
					}

					return true; //close
				};

				$.jbox.confirm("确定要删除数据吗？", "提示", submit);

				return false;

			});

		});
	</script>

</block>